
	// APPEARANCE

		foreach p in b e {

			gen clothescondqual_`p' = (clothescond_`p'==1)
				la var clothescondqual_`p' "1 if clothes in good repair"

			gen cleanfacequal_`p' = (cleanface_`p'==1)
				la var cleanfacequal_`p' "1 if face is clean"

			gen hairqual_`p' = (hair_`p'==1)
				la var hairqual_`p' "1 if hair are cut low"

			gen fingernailsqual_`p' = (fingernails_`p'==1)
				la var fingernailsqual_`p' "1 if finger are clean"

			gen breathqual_`p' = (breath_`p'==1)
				la var breathqual_`p' "1 if breathe quality"

			egen apparencequalindex_`p' = rowtotal (clothescondqual_`p' cleanfacequal_`p' hairqual_`p' fingernailsqual_`p' breathqual_`p')
				la var apparencequalindex_`p' "Quality of the appearance index (ADD GOOD) (0-5)"

		}

qui gen shoecond_resc_e = shoecond_e if shoecond_e!=6
	qui replace shoecond_resc_e = 5 - shoecond_resc_e
	la def shoe1 0 "Barefoot" 1 "Slippers" 2 "Shoes in poor repair" 3 "Shoes, dirty, in good repair" 4 "Shoes, clean, in good repair"
	la val shoecond_resc_e shoe1
	la var shoecond_resc_e "Shoe quality at endline (0-4; Positive: Good)"

qui gen breath_resc_e = (breath_e == 1 | breath_e == 2) if !missing(breath_e)
	la var breath_resc_e "Breath at endline (0-1; Positive: Good)"

qui gen clothescond_resc_e = 3- clothescond_e
	la var clothescond_resc_e "Clothing quality at endline (0-2; Positive: Good)"

qui gen cleanface_resc_e = 3- cleanface_e
	la var cleanface_resc_e "Cleanliness of face at endline (0-2; Positive: Good)"

qui gen hair_resc_e = 3- hair_e
	la var hair_resc_e "Cleanliness of hair at endline (0-2; Positive: Good)"

qui gen fingernails_resc_e = 3- fingernails_e
	la var fingernails_resc_e "Cleanliness of fingernails at endline (0-2; Positive: Good)"


// CONTRIBUTION TO PUBLIC GOODS (p1_e5m, p1_e12m)

		gen publicgoodcontr_e = (volroad6mx_e>0 | volwater6mx_e >0 |volbldgoth6mx_e>0 | volschl6mx_e>0 | vollatrine6mx_e>0 | voloth6mx_e>0 | volfuneral6mx_e>0) if p1_e5m==1 | p1_e12m==1
			la var publicgoodcontr_e "1 if contributed to public good provision"

		egen publicgoodcontrnumb_e = rowtotal (volroad6mx_e volwater6mx_e volbldgoth6mx_e volschl6mx_e vollatrine6mx_e voloth6mx_e volfuneral6mx_e  ) if p1_e5m==1  | p1_e12m==1
			la var publicgoodcontrnumb_e "Nb of times they contributed in public good provision in past 6m"

	// TRUST INDEX

		foreach x in trustrelatives trusttleader trustngos trustipal {
				gen `x'_resc_e = 0 if `x'_e == "1-Not at all"
				replace `x'_resc_e = 1 if `x'_e == "2-Just a little"
				replace `x'_resc_e = 2 if `x'_e == "3-Somewhat"
				replace `x'_resc_e = 3 if `x'_e == "4-A lot"

				local lab: var lab `x'_e
				la var `x'_resc_e "Resc: `lab' (0-3)"
			}

	egen trustindex_e=rowtotal(trustrelatives_resc_e trusttleader_resc_e trustngos_resc_e trustipal_resc_e), m
	qui sum trustindex_e
	qui replace trustindex_e = (trustindex_e-r(mean))/r(sd)
	la var trustindex_e "Trust Index, z-score"

	// GROUP LEADER INDEX

		* recode startgroup_e
		gen startgroup_resc_e = 1 if startgroup_e == "Y"
		replace startgroup_resc_e = 0 if startgroup_e == "N"

		egen groupleadindex_e = rowtotal(leader_e bigman_e groupcommleader_e startgroup_resc_e),m
			qui sum groupleadindex_e
			qui replace groupleadindex_e = (groupleadindex_e-r(mean))/r(sd)
			la var groupleadindex_e "Group Leader Index, Z-score"
